3.1.52 \(\int \sqrt {a+b \cos (c+d x)} \, dx\) [52]

Optimal. Leaf size=57 \[ \frac {2 \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}} \]

[Out]

2*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2)*(b/(a+b))^(1/2))*(a+b*c
os(d*x+c))^(1/2)/d/((a+b*cos(d*x+c))/(a+b))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2734, 2732} \begin {gather*} \frac {2 \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*Cos[c + d*x]],x]

[Out]

(2*Sqrt[a + b*Cos[c + d*x]]*EllipticE[(c + d*x)/2, (2*b)/(a + b)])/(d*Sqrt[(a + b*Cos[c + d*x])/(a + b)])

Rule 2732

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[2*(Sqrt[a + b]/d)*EllipticE[(1/2)*(c - Pi/2
+ d*x), 2*(b/(a + b))], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]

Rule 2734

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[Sqrt[a + b*Sin[c + d*x]]/Sqrt[(a + b*Sin[c +
 d*x])/(a + b)], Int[Sqrt[a/(a + b) + (b/(a + b))*Sin[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 -
 b^2, 0] &&  !GtQ[a + b, 0]

Rubi steps

\begin {align*} \int \sqrt {a+b \cos (c+d x)} \, dx &=\frac {\sqrt {a+b \cos (c+d x)} \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{\sqrt {\frac {a+b \cos (c+d x)}{a+b}}}\\ &=\frac {2 \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 57, normalized size = 1.00 \begin {gather*} \frac {2 \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b*Cos[c + d*x]],x]

[Out]

(2*Sqrt[a + b*Cos[c + d*x]]*EllipticE[(c + d*x)/2, (2*b)/(a + b)])/(d*Sqrt[(a + b*Cos[c + d*x])/(a + b)])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(169\) vs. \(2(82)=164\).
time = 0.26, size = 170, normalized size = 2.98

method result size
default \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) \left (a -b \right )}{\sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a +b}\, d}\) \(170\)
risch \(-\frac {i \sqrt {2}\, \sqrt {\left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right ) {\mathrm e}^{-i \left (d x +c \right )}}}{d}-\frac {i \left (\frac {2 a \left (a +\sqrt {a^{2}-b^{2}}\right ) \sqrt {\frac {\left ({\mathrm e}^{i \left (d x +c \right )}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right ) b}{a +\sqrt {a^{2}-b^{2}}}}\, \sqrt {\frac {{\mathrm e}^{i \left (d x +c \right )}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}}{-\frac {a +\sqrt {a^{2}-b^{2}}}{b}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}}}\, \sqrt {-\frac {b \,{\mathrm e}^{i \left (d x +c \right )}}{a +\sqrt {a^{2}-b^{2}}}}\, \EllipticF \left (\sqrt {\frac {\left ({\mathrm e}^{i \left (d x +c \right )}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right ) b}{a +\sqrt {a^{2}-b^{2}}}}, \sqrt {-\frac {a +\sqrt {a^{2}-b^{2}}}{b \left (-\frac {a +\sqrt {a^{2}-b^{2}}}{b}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}\right )}}\right )}{b \sqrt {b \,{\mathrm e}^{3 i \left (d x +c \right )}+2 a \,{\mathrm e}^{2 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )} b}}+b \left (-\frac {2 \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{b \sqrt {\left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right ) {\mathrm e}^{i \left (d x +c \right )}}}+\frac {2 \left (a +\sqrt {a^{2}-b^{2}}\right ) \sqrt {\frac {\left ({\mathrm e}^{i \left (d x +c \right )}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right ) b}{a +\sqrt {a^{2}-b^{2}}}}\, \sqrt {\frac {{\mathrm e}^{i \left (d x +c \right )}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}}{-\frac {a +\sqrt {a^{2}-b^{2}}}{b}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}}}\, \sqrt {-\frac {b \,{\mathrm e}^{i \left (d x +c \right )}}{a +\sqrt {a^{2}-b^{2}}}}\, \left (\left (-\frac {a +\sqrt {a^{2}-b^{2}}}{b}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}\right ) \EllipticE \left (\sqrt {\frac {\left ({\mathrm e}^{i \left (d x +c \right )}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right ) b}{a +\sqrt {a^{2}-b^{2}}}}, \sqrt {-\frac {a +\sqrt {a^{2}-b^{2}}}{b \left (-\frac {a +\sqrt {a^{2}-b^{2}}}{b}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}\right )}}\right )+\frac {\left (-a +\sqrt {a^{2}-b^{2}}\right ) \EllipticF \left (\sqrt {\frac {\left ({\mathrm e}^{i \left (d x +c \right )}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right ) b}{a +\sqrt {a^{2}-b^{2}}}}, \sqrt {-\frac {a +\sqrt {a^{2}-b^{2}}}{b \left (-\frac {a +\sqrt {a^{2}-b^{2}}}{b}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}\right )}}\right )}{b}\right )}{b \sqrt {b \,{\mathrm e}^{3 i \left (d x +c \right )}+2 a \,{\mathrm e}^{2 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )} b}}\right )\right ) \sqrt {2}\, \sqrt {\left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right ) {\mathrm e}^{-i \left (d x +c \right )}}\, \sqrt {\left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right ) {\mathrm e}^{i \left (d x +c \right )}}}{d \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}\) \(1046\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cos(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2*((2*cos(1/2*d*x+1/2*c)^2*b+a-b)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)*((2*cos(1/2*d*x+1/
2*c)^2*b+a-b)/(a-b))^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),(-2*b/(a-b))^(1/2))*(a-b)/(-2*sin(1/2*d*x+1/2*c)^4*b+(
a+b)*sin(1/2*d*x+1/2*c)^2)^(1/2)/sin(1/2*d*x+1/2*c)/(-2*sin(1/2*d*x+1/2*c)^2*b+a+b)^(1/2)/d

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(b*cos(d*x + c) + a), x)

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.13, size = 355, normalized size = 6.23 \begin {gather*} \frac {-i \, \sqrt {2} a \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + i \, \sqrt {2} a \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + 3 i \, \sqrt {2} b^{\frac {3}{2}} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) - 3 i \, \sqrt {2} b^{\frac {3}{2}} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right )}{3 \, b d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/3*(-I*sqrt(2)*a*sqrt(b)*weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b*c
os(d*x + c) + 3*I*b*sin(d*x + c) + 2*a)/b) + I*sqrt(2)*a*sqrt(b)*weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2,
-8/27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) - 3*I*b*sin(d*x + c) + 2*a)/b) + 3*I*sqrt(2)*b^(3/2)*weiers
trassZeta(4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*a^3 - 9*a*b^2)/b^3, weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2, -
8/27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) + 3*I*b*sin(d*x + c) + 2*a)/b)) - 3*I*sqrt(2)*b^(3/2)*weiers
trassZeta(4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*a^3 - 9*a*b^2)/b^3, weierstrassPInverse(4/3*(4*a^2 - 3*b^2)/b^2, -
8/27*(8*a^3 - 9*a*b^2)/b^3, 1/3*(3*b*cos(d*x + c) - 3*I*b*sin(d*x + c) + 2*a)/b)))/(b*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \cos {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a + b*cos(c + d*x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(b*cos(d*x + c) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \sqrt {a+b\,\cos \left (c+d\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*cos(c + d*x))^(1/2),x)

[Out]

int((a + b*cos(c + d*x))^(1/2), x)

________________________________________________________________________________________